package com.api.shopapi.service.impl;



import com.api.shopapi.entity.InterfaceTime;
import com.api.shopapi.entity.dto.InterfaceTimeDTO;
import com.api.shopapi.mapper.InterfaceTimeMapper;
import com.api.shopapi.service.InterfaceTimeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("InterfaceTimeServiceImplOne")
public class InterfaceTimeServiceImpl  implements InterfaceTimeService {

    @Autowired
    private InterfaceTimeMapper interfaceTimeMapper;


    @Override
    public int insert(InterfaceTime interfaceTime) {
        return interfaceTimeMapper.insert(interfaceTime);
    }

    @Override
    public PageInfo<InterfaceTimeDTO> getList(int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<InterfaceTimeDTO> list =interfaceTimeMapper.getList();
        return new PageInfo<>(list);
    }

    @Override
    public int delete(String interfaceTimeCode) {
        return interfaceTimeMapper.delete(interfaceTimeCode);
    }

    @Override
    public InterfaceTime getByInterfaceTimeCode(String interfaceTimeCode) {
        return interfaceTimeMapper.getByInterfaceTimeCode(interfaceTimeCode);
    }

    @Override
    public List<InterfaceTime> getByInterface(String interfaces) {
        return interfaceTimeMapper.getByInterface(interfaces);
    }
}
